home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
HPAVC
/
HPAVC CD-ROM.iso
/
MCASM.RAR
/
MC_ASM.EXE
/
WROX_ASM
/
CH12
/
FONTS
/
PROG5_2.C
< prev
Wrap
C/C++ Source or Header
|
1994-06-16
|
845b
|
41 lines
/* This sample program demonstrates use of OverlapString,
* an external procedure from Prog5_1.ASM.
* Written by Kiselev J. CZ 1994.
*/
#include <dos.h>
extern "C" void OverlapString(int,int,void*,void*,int,int);
char str[30] = "Hi, folks, I am a raster font!";
/* Pointer to character table */
void *fontptr;
int char_height;
void main(void)
{
/* Video mode 12h */
_AX = 0x12;
/* Call BIOS service Set Mode */
geninterrupt(0x10);
asm {
push si
mov ax,0
mov es,ax
mov si,0x43*4 // Vector 43h - pointer to the current BIOS font
mov ax,es:[si]
mov word ptr fontptr[0],ax
mov ax,es:[si+2]
mov word ptr fontptr[2],ax
mov ax,0x40
mov es,ax
mov ax,es:[0x85] // 0040:0085 - character height
mov char_height,ax
pop si
}
OverlapString(100,100,str,fontptr,char_height,8);
}